﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using SpeechLib;

namespace queue
{
    class Speech
    {
        //public override void Dispose()
        //{
            
        //    if (components != null)
        //        components.Dispose();
        //}
        public void SpeechText(string text)
        {
            try
            {
                SpeechVoiceSpeakFlags SpFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
                SpVoice Voice = new SpVoice();
                Voice.Speak(text, SpFlags);                
            }

            catch (Exception error)
            {
                MessageBox.Show("Speak error", "SimpleTTS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

        }
    }
}
